/*
 * =====================================================================================
 *
 *       Filename:  testftell.cpp
 *
 *    Description:  v
 *
 *        Version:  1.0
 *        Created:  08/03/2012 04:22:33 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  YOUR NAME (), 
 *        Company:  
 *
 * =====================================================================================
 */
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
int main()
{
    FILE *fp=fopen("./abc.txt","r");
    char buf[1024]={0};
    long position=0;
    position=ftell(fp);
    cout<<"ftell\t"<<position<<endl;
    fgets(buf,1024,fp);
    buf[strlen(buf)]='\0';
    cout<<"buf\t"<<buf<<"\tlen:\t"<<strlen(buf)<<endl;
    position=ftell(fp);
    cout<<"ftell after 16\t"<<position<<endl;
}
